package com.sls.nzdapplication.model;


import com.alibaba.fastjson.JSONObject;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;

import java.util.Date;

@Entity
public class User {

    @Id
    private String id;

    private String username;

    private String address;

    private String userCode;

    private String electricityMeterOfficeNumber;

    private String barCode;

    private String serialNumber;

    private String modifyBoxCode;

    private String userBoxNumber;

    private Date createTime;

    private String createBy;

    private Date modifyTime;

    private String modifyBy;

    private String areaId;

    public JSONObject toJson(){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("id",this.id);
        jsonObject.put("username",this.username);
        jsonObject.put("address",this.address);
        jsonObject.put("userCode",this.userCode);
        jsonObject.put("electricityMeterOfficeNumber",this.electricityMeterOfficeNumber);
        jsonObject.put("barCode",this.barCode);
        jsonObject.put("serialNumber",this.serialNumber);
        jsonObject.put("modifyBoxCode",this.modifyBoxCode);
        jsonObject.put("userBoxNumber",this.userBoxNumber);
        jsonObject.put("createTime",this.createTime);
        jsonObject.put("createBy",this.createBy);
        jsonObject.put("modifyTime",this.modifyTime);
        jsonObject.put("modifyBy",this.modifyBy);
        jsonObject.put("areaId",this.areaId);
        return jsonObject;
    }

    public User(JSONObject jsonObject){
        this.id = jsonObject.getString("id");
        this.username = jsonObject.getString("username")==null?"":jsonObject.getString("username");
        this.createTime = jsonObject.getDate("createTime");
        this.createBy = jsonObject.getString("createBy");
        this.modifyBy = jsonObject.getString("modifyBy");
        this.modifyTime = jsonObject.getDate("modifyTime");
        this.address = jsonObject.getString("address")==null?"":jsonObject.getString("address");
        this.userCode = jsonObject.getString("userCode")==null?"":jsonObject.getString("userCode");
        this.electricityMeterOfficeNumber = jsonObject.getString("electricityMeterOfficeNumber")==null?"":jsonObject.getString("electricityMeterOfficeNumber");
        this.barCode = jsonObject.getString("barCode")==null?"":jsonObject.getString("barCode");
        this.serialNumber = jsonObject.getString("serialNumber")==null?"":jsonObject.getString("serialNumber");
        this.modifyBoxCode = jsonObject.getString("modifyBoxCode")==null?"":jsonObject.getString("modifyBoxCode");
        this.userBoxNumber = jsonObject.getString("userBoxNumber")==null?"":jsonObject.getString("userBoxNumber");
        this.areaId = jsonObject.getString("areaId")==null?"":jsonObject.getString("areaId");
    }

    @Generated(hash = 371539061)
    public User(String id, String username, String address, String userCode,
            String electricityMeterOfficeNumber, String barCode,
            String serialNumber, String modifyBoxCode, String userBoxNumber,
            Date createTime, String createBy, Date modifyTime, String modifyBy,
            String areaId) {
        this.id = id;
        this.username = username;
        this.address = address;
        this.userCode = userCode;
        this.electricityMeterOfficeNumber = electricityMeterOfficeNumber;
        this.barCode = barCode;
        this.serialNumber = serialNumber;
        this.modifyBoxCode = modifyBoxCode;
        this.userBoxNumber = userBoxNumber;
        this.createTime = createTime;
        this.createBy = createBy;
        this.modifyTime = modifyTime;
        this.modifyBy = modifyBy;
        this.areaId = areaId;
    }

    @Generated(hash = 586692638)
    public User() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUsername() {
        return this.username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getAddress() {
        return this.address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getUserCode() {
        return this.userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    public String getElectricityMeterOfficeNumber() {
        return this.electricityMeterOfficeNumber;
    }

    public void setElectricityMeterOfficeNumber(
            String electricityMeterOfficeNumber) {
        this.electricityMeterOfficeNumber = electricityMeterOfficeNumber;
    }

    public String getBarCode() {
        return this.barCode;
    }

    public void setBarCode(String barCode) {
        this.barCode = barCode;
    }

    public String getSerialNumber() {
        return this.serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    public String getModifyBoxCode() {
        return this.modifyBoxCode;
    }

    public void setModifyBoxCode(String modifyBoxCode) {
        this.modifyBoxCode = modifyBoxCode;
    }

    public String getUserBoxNumber() {
        return this.userBoxNumber;
    }

    public void setUserBoxNumber(String userBoxNumber) {
        this.userBoxNumber = userBoxNumber;
    }

    public Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public Date getModifyTime() {
        return this.modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public String getModifyBy() {
        return this.modifyBy;
    }

    public void setModifyBy(String modifyBy) {
        this.modifyBy = modifyBy;
    }

    public String getAreaId() {
        return this.areaId;
    }

    public void setAreaId(String areaId) {
        this.areaId = areaId;
    }


}
